package com.jacars.biz.user.dao.service.impl;

import com.jacars.biz.user.dao.mapper.JsptRoleMenuMapper;
import com.jacars.biz.user.dao.model.JsptRoleMenu;
import com.jacars.biz.user.dao.service.JsptRoleMenuService;
import com.jacars.common.model.JsptMenu;
import com.jacars.common.service.impl.SuperServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

/**
 * @author zlt
 */
@Slf4j
@Service
public class JsptRoleMenuServiceImpl extends SuperServiceImpl<JsptRoleMenuMapper, JsptRoleMenu> implements JsptRoleMenuService {
    @Resource
    private JsptRoleMenuMapper jsptRoleMenuMapper;

    @Override
    public int save(Long roleId, Long menuId) {
        return jsptRoleMenuMapper.save(roleId, menuId);
    }

    @Override
    public int delete(Long roleId, Long menuId) {
        return jsptRoleMenuMapper.delete(roleId, menuId);
    }

    @Override
    public List<JsptMenu> findMenusByRoleIds(Set<Long> roleIds, Integer type) {
        return jsptRoleMenuMapper.findMenusByRoleIds(roleIds, type);
    }

    @Override
    public List<JsptMenu> findMenusByRoleCodes(Set<String> roleCodes, Integer type) {
        return jsptRoleMenuMapper.findMenusByRoleCodes(roleCodes, type);
    }
}
